package com.qf.controller;

import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/6/30 19:09
 */
@RestController
public class HelloController {

    /**
     * 注入初始化的user对象
     */
    @Resource(name = "user1")
    private User user;

    @Value("${alibaba.ip}")
    private String ip;

    @Value("${alibaba.userName}")
    private String userName;

    @Value("${alibaba.password}")
    private String password;

    @RequestMapping("/hello")
    public String hello(){
        Integer id = user.getId();
        String name = user.getName();
        System.out.println(ip);
        System.out.println(userName);
        System.out.println(password);
        return id+name+"欢迎访问Springboot的hello页面!";
    }
}
